﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Chess;

namespace ChessConsumer
{
    class Program
    {
        static void Main(string[] args)
        {
            ChessGame g = new ChessGame();

            Print(g);

            Console.WriteLine(g.TryMakeMove(1, 1, 3, 1));
            Print(g);

            Console.WriteLine(g.TryMakeMove(0, 2, 2, 3));
            Print(g);
        }

        static void Print(ChessGame game)
        {
            for (int r = 0; r < ChessBoard.Rows; r++)
            {
                for (int c = 0; c < ChessBoard.Columns; c++)
                {
                    char ch = '-';

                    switch (game.ChessBoard[r, c])
                    {
                        case ChessCell.Empty:
                            ch = '-';
                            break;

                        case ChessCell.WhiteKing:
                            ch = 'K';
                            break;

                        case ChessCell.WhiteQueen:
                            ch = 'Q';
                            break;

                        case ChessCell.WhiteRook:
                            ch = 'R';
                            break;

                        case ChessCell.WhiteKnight:
                            ch = 'H';
                            break;

                        case ChessCell.WhiteBishop:
                            ch = 'B';
                            break;

                        case ChessCell.WhitePawn:
                            ch = 'P';
                            break;

                        case ChessCell.BlackKing:
                            ch = 'k';
                            break;

                        case ChessCell.BlackQueen:
                            ch = 'q';
                            break;

                        case ChessCell.BlackRook:
                            ch = 'r';
                            break;

                        case ChessCell.BlackKnight:
                            ch = 'h';
                            break;

                        case ChessCell.BlackBishop:
                            ch = 'b';
                            break;

                        case ChessCell.BlackPawn:
                            ch = 'p';
                            break;

                        default:
                            break;
                    }

                    Console.Write("{0}  ", ch);
                }

                Console.WriteLine();
            }
        }
    }
}
